package com.inspur.resourcequery.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.inspur.resourcequery.fragment.PhysicsBasketFragment;
import com.inspur.resourcequery.fragment.PhysicsBoardFragment;
import com.inspur.resourcequery.fragment.PhysicsFrameFragment;
import com.inspur.resourcequery.fragment.PhysicsPortFragment;

public class PhysicsInfoPagerAdapter extends FragmentPagerAdapter {
	
	public final static int TAB_INDEX_TAB_1 = 0;
	public final static int TAB_INDEX_TAB_2 = 1;
	public final static int TAB_INDEX_TAB_3 = 2;
	public final static int TAB_INDEX_TAB_4 = 3;
	public final static int TAB_COUNT = 4;
	
	public PhysicsInfoPagerAdapter(FragmentManager fm) {  
        super(fm);  
        // TODO Auto-generated constructor stub  
    }  
  
    @Override  
    public Fragment getItem(int pos) {  
        // TODO Auto-generated method stub  
        switch (pos) {  
        case TAB_INDEX_TAB_1:  
            return new PhysicsFrameFragment();  
        case TAB_INDEX_TAB_2:  
            return new PhysicsBasketFragment();  
        case TAB_INDEX_TAB_3:  
        	return new PhysicsBoardFragment();  
        case TAB_INDEX_TAB_4:  
        	return new PhysicsPortFragment();  
        }  
  
        throw new IllegalStateException("No fragment at position " + pos);  
    }  
  
    @Override  
    public int getCount() {  
        // TODO Auto-generated method stub  
        return TAB_COUNT;  
    }  
}
